<template>
  <div class="child-page">
    <div> 子的玩具{{ toy }}</div>
    <button @click="emit('send-data',toy)">发送玩具</button>
  </div>
</template>
<script setup lang="ts" name="propsChild">
import { ref,defineEmits } from 'vue';

const toy = ref('熊猫');

const emit = defineEmits(['send-data'])

</script>
<style  scoped>
.child-page{
  padding: 20px 50px;
  height: 100px;
  background: green;
  color: #fff;
}
</style>
